<template>
  <!-- <div class="header-top">
    <div class="header-top__content">
      <div class="btn-back" @click="backFn">
        <i class="el-icon-arrow-left"/>
      </div>
      <span class="header-title">{{title}}</span>
    </div>
  </div> -->
  <!-- 上面这一段，不知道为什么，老有px适配问题 -->
  <div class="header">
    <div class="title">
      <i class="el-icon-arrow-left" @click="backFn" v-if="showBack"/>
      <h1>{{ title }}</h1>
    </div>
  </div>
</template>

<script>
export default {
  name: 'headerTop',
  props: {
    title: {
      type: String,
    },
    showBack: {
      type: Boolean,
      default: true,
    },
  },
  methods: {
    backFn: function () {
      this.$router.go(-1)
    },
  },
}
</script>

<style lang="scss" scoped>
.header {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;

  .title {
    min-width: 455px;
    height: 85px;
    position: relative;
    background: url('../../../assets/images/header_top_bg.png') no-repeat;
    background-size: 100% 100%;
    padding: 0 30px;
    padding-bottom: 12px;
    display: flex;
    align-items: flex-end;
    h1 {
      color: #fff;
      font-size: 28px;
    }
  }
  i {
    &::before {
      color: #fff;
      font-size: 36px;
    }
  }
}
.header-top {
  height: 85px;
  background: url('../../../assets/images/header_top_bg.png') no-repeat;

  .header-top__content {
    padding-top: 28px;
    padding-left: 34px;
    height: 85px;
    line-height: 42px;
    font-size: 28px;
    color: #ffffff;

    .btn-back {
      display: inline-block;
      height: 42px;
      font-size: 32px;
      line-height: 42px;
    }
    .header-title {
      height: 42px;
      line-height: 42px;
    }
  }
}
</style>
